package com.smforj.ssm.mina.client;


/**
 * mina 客户端测试类
 * @desp
 * @author ghj
 * @date 2016-3-8 下午6:19:39
 */
public class RunClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		for(int i=0;i<1;i++)
		{
			Thread t = new Thread(new Runnable() { 
				@Override
				public void run() {
					TT1();
				}
			});
			t.start();
		}
	}
	public static void TT1()
	{
		IMinaClent client = new MinaClient(); 
		client.setHost("127.0.0.1");
		client.setPort(1235);
        if (client.iconnect()) { 
        	//TsExamineeModel model = new TsExamineeModel();  
    		StringBuilder sb = new StringBuilder(); 
    		//标识该信息为打印信息
    		sb.append("hisigngate  00481234567890123456789012345678901234567890" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH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WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH" +
    				"WHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWHWH"); 
            client.send(sb.toString());  
            //client.close();
        }
	}
	public static void TT()
	{
		IMinaClent client = new MinaClient(); 
		client.setHost("127.0.0.1");
		client.setPort(6789);
        if (client.iconnect()) { 
        	//TsExamineeModel model = new TsExamineeModel();  
    		StringBuilder sb = new StringBuilder(); 
    		//标识该信息为打印信息
    		sb.append("p");
    		//打印内容 格式化
    		sb.append("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
    		sb.append("<labels>");
    		sb.append("<label top=\"5\" bottom=\"15\" left=\"15\">");
    		sb.append("<row height=\"5\" bottom=\"6\"><col font=\"0\" bold=\"0\"></col><col font=\"2\" bold=\"1\">          张三</col></row>");
    		sb.append("<row height=\"3\" bottom=\"2\"><col font=\"0\" bold=\"0\">身份证号：</col><col font=\"0\" bold=\"0\">325435435435435</col></row>");
    		sb.append("<row height=\"3\" bottom=\"2\"><col font=\"0\" bold=\"0\">准考证号：</col><col font=\"0\" bold=\"0\">35423534545435435</col></row>");
    		sb.append("<row height=\"3\" bottom=\"2\"><col font=\"0\" bold=\"0\">考试科目：</col><col font=\"0\" bold=\"0\">数学</col></row>");
    		sb.append("<row height=\"3\" bottom=\"2\"><col font=\"0\" bold=\"0\">考场号   ：</col><col font=\"0\" bold=\"0\">708</col></row>");
    		sb.append("<row height=\"6\" bottom=\"10\"><col font=\"0\" bold=\"0\">核验类型：</col><col font=\"0\" bold=\"0\">机器核验</col></row>");
    		sb.append("</label>");
    		sb.append("</labels>"); 
            client.send(sb.toString()); 
  /*          @SuppressWarnings("resource")
			Scanner scanner = new Scanner(System.in); 
            while (scanner.hasNext()) { 
                client.send(scanner.next());

            }*/
            client.close();
        }
	}

}
